home *** CD-ROM | disk | FTP | other *** search
- #include <Types.h>
- #include <memory.h>
- #include <Packages.h>
- #include <Errors.h>
- #include <quickdraw.h>
- #include <fonts.h>
- #include <dialogs.h>
- #include <windows.h>
- #include <menus.h>
- #include <events.h>
- #include <OSEvents.h>
- #include <Desk.h>
- #include <diskinit.h>
- #include <OSUtils.h>
- #include <resources.h>
- #include <toolutils.h>
- #include <AppleEvents.h>
- #include <EPPC.h>
- #include <GestaltEqu.h>
- #include <PPCToolbox.h>
- #include <Processes.h>
- #include <Balloons.h>
- #include <aliases.h>
-
- typedef void (*myDrawProcPtr)(WindowPtr theWindow);
- typedef void (*myClickProcPtr)(WindowPtr theWindow,EventRecord *theEvent);
- typedef void (*windowSaveProc)(WindowPtr theWindow);
- typedef void (*myCloseProcPtr)(WindowPtr theWindow);
- typedef void (*mySizeProcPtr)(WindowPtr theWindow,short how);
- typedef void (*myActivateProcPtr)(WindowPtr theWindow,Boolean active);
-
- /* windowControl is the structure attached to every window I create (in the refCon */
- /* field) that contains all the information I need to know about the window. */
- /* data, procedure pointers for controlling, and anything else gets put in this */
- /* struct. That makes my windows autonomous */
- struct windowControl {
- unsigned long windowID; /* master ID number */
- myDrawProcPtr drawMe; /* content drawing procedure pointer */
- myClickProcPtr clickMe; /* content click routine */
- myCloseProcPtr closeMe; /* document close procedure pointer */
- mySizeProcPtr sizeMe; /* size procedure */
- myActivateProcPtr activateMe;
- AliasHandle fileAliasHandle; /* alias for this document */
- Boolean windowDirty;
- Handle generalData; /* cast to whatever you need as you need it */
- };
- typedef struct windowControl windowControl, *windowCPtr, **windowCHandle;
-
- struct AEinstalls {
- AEEventClass theClass;
- AEEventID theEvent;
- EventHandlerProcPtr theProc;
- };
- typedef struct AEinstalls AEinstalls;
-
- enum {kDocWindowResID = 128,kMyDocumentWindow = 1000};
- /* menu enums */
- enum {kMBarID = 128};
- enum {kAppleMenu = 128,kFileMenu,kEditMenu,kToolsMenu};
-
- /* file menu enums */
- enum {kNewItem = 1,kOpenItem,kCloseItem,kSaveItem,kSaveAsItem,kFileBlank1,kPageSetupItem,kPrintItem,kFileBlank2,kQuitItem};
-
- /* general purpose enums */
- enum {kResumeMask=1,kSampHelp=129,kAboutBox=128,kHelpString=128,kBadSystem=130};
-
- enum {kMinHeight = 200};
-
- enum {kGeneralStrings = 128};
- enum {kblankstring1=1,kkblankstring2,kblankstring3,kblankstring4,kDadWords,kToWord};
-
- enum {
- kHomeKey = 1,
- kEnterKey = 0x3,
- kHelpKey = 5,
- kDeleteKey = 8,
- kTabKey = 9,
- kPageUpKey = 0x0b,
- kPageDownKey,
- kReturnKey = 0x0d,
- kEscKey = 0x1B,
- kLeftArrowKey,
- kRightArrowKey,
- kUpArrowKey,
- kDownArrowKey,
- kSpaceKey,
- kFDeleteKey = 0x7f,
-
- };
- enum {kDateDialog = 130};